package com.jcxt.sys.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jcxt.sys.common.DataGridView;
import com.jcxt.sys.domain.Role;
import com.jcxt.sys.domain.SysEnum;
import com.jcxt.sys.service.ISysEnumService;
import com.jcxt.sys.vo.RoleVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author klj
 * @since 2020-12-25
 */
@RestController
@RequestMapping("/sys-enum")
public class SysEnumController {

  @Autowired
  private ISysEnumService iSysEnumService;

    /**
     * 查询
     */
    @GetMapping("/list/{parentId}")
    public DataGridView loadSyEnumByParentId(@PathVariable("parentId") Integer parentId) {
        List<SysEnum> list = iSysEnumService.list(Wrappers.<SysEnum>lambdaQuery().eq(SysEnum::getParentId, parentId));
        return new DataGridView(list);
    }

}
